<template>
    <div class="userCenter">
        <div class="breadcrumb-box">
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>个人中心</el-breadcrumb-item>
                <el-breadcrumb-item>设置</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="center container td-f">
            <left-nav-bar :active="active"></left-nav-bar>
            <div class="right">
                <div class="line-ti">
                    <div>设置</div>
                </div>
                <div class="list-help">
                    <ul class="helps">
                        <router-link :to="`/setting`">
                            <img src="../../assets/second_icon/person.png" alt="">
                            <div>个人信息</div>
                        </router-link>
                        <router-link :to="`/aboutUs`">
                            <img src="../../assets/second_icon/aboutUs.png" alt="">
                            <div>关于我们</div>
                        </router-link>
                        <router-link :to="`/helpCenter`">
                            <img src="../../assets/second_icon/helpCenter.png" alt="">
                            <div>帮助中心</div>
                        </router-link>
                        <router-link :to="`/changePwd`">
                            <img src="../../assets/second_icon/pwd.png" alt="">
                            <div>修改密码</div>
                        </router-link>
                    </ul>
                </div>
            </div>
        </div>
        <div style="height: 200px"></div>
    </div>
</template>

<script>
import leftNavBar from "@components/leftNavBar";
import { getUser, getMyMessage, searchQuota } from "@api/user";

export default {
    name: "userCenter",
    data() {
        return {
            loading: false,
            active: 9,
            userInfo: {},
            messageList: [],
            quotaInfo: "",
            orderStatusNum: {},
            dialogImageUrl: "",
            dialogVisible: false,
        };
    },
    components: {
        leftNavBar,
    },
    methods: {
        handleRemove(file, fileList) {
            console.log(file, fileList);
        },
        handlePictureCardPreview(file) {
            this.dialogImageUrl = file.url;
            this.dialogVisible = true;
        },
        User() {
            let that = this;
            getUser().then((res) => {
                that.userInfo = res.data;

                that.orderStatusNum = res.data.orderStatusNum;
            });
        },
        searchQuota() {
            let params = {
                name: 123,
            };
            searchQuota(params).then((res) => {
                this.quotaInfo = res.data;
            });
        },
        getMessage() {
            getMyMessage(this.where).then(
                (res) => {
                    // that.loaded = res.data.length < that.where.limit;
                    // that.where.page = that.where.page + 1;
                    this.loading = true;
                    this.messageList.push.apply(this.messageList, res.data);
                },
                (error) => {
                    this.$dialog.message(error.msg);
                }
            );
        },
        goOrderList(index) {
            this.$router.push("/order?type=" + index);
        },
    },
    mounted() {
        this.User();
        this.getMessage();
        this.searchQuota();
    },
};
</script>
<style >
.el-upload--picture-card {
    width: 88px;
    height: 88px;
    line-height: 88px;
}
.el-upload-list--picture-card .el-upload-list__item {
    width: 88px;
    height: 88px;
}
</style>
<style scoped  rel="stylesheet/scss" lang="scss" scoped>
$color: #da213d;
.userCenter {
    width: 100%;
    height: 100%;

    .center {
        /*width: 70%;*/
        margin: 0 auto;
        display: flex;

        .right {
            width: 1000px;
            margin-left: 32px;
            /*margin-top: 90px;*/
            .line-ti {
                width: 100%;
                border-bottom: 1px solid #dbdbdb;

                > div {
                    color: #da213d;
                    font-size: 18px;
                    font-family: MicrosoftYaHei-Bold;
                    border-bottom: 3px solid $color;
                    width: 72px;
                    line-height: 36px;
                    font-weight: 600;
                }
            }

            .list-help {
                margin-top: 32px;

                .helps {
                    a {
                        margin-top: 10px;
                        width: 430px;
                        height: 50px;
                        border-radius: 8px;
                        border: 1px solid #efc2c1;
                        display: flex;
                        align-items: center;
                        div {
                            font-size: 15px;
                            color: #333333;
                        }
                        img {
                            width: 18px;
                            height: 18px;
                            margin-right: 20px;
                            margin-left: 20px;
                        }
                    }
                }
            }
        }
    }
}
</style>
